package com.joker.aigc.oj.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import jakarta.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@Schema(description = "人才库，求职人员" ,name = "RecruitApply")
@TableName(value = "recruit_application")
public class RecruitApply implements Serializable {


    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "用户id 唯一")
    private Long id;

    @Schema(description = "申请人")
    private Long userId;

    @Schema(description = "申请部门")
    @NotNull(message = "人才招聘申请表id raId 必须填写")
    private Long departmentId;

    private String departmentName;

    @NotNull(message = "开始时间不能为空")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @Schema(description = "招聘时间")
    private LocalDateTime start;

    @NotNull(message = "结束时间不能为空")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @Schema(description = "招聘结束时间")
    private LocalDateTime end;


    @Schema(description = "申请理由")
    private String reason;


    @Schema(description = "招聘申请是否通过")
    private Integer pass;

    @Schema(description = "人才需要人数")
    private Integer number;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "开始时间不能为空")
    @Schema(description = "笔试时间")
    private LocalDateTime writeStart;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @Schema(description = "招聘面试时间")
    @NotNull(message = "面试不能为空")
    private LocalDateTime meetingStart;

    @Schema(description = "笔试权重。")
    private Double writeWeight;

    @Schema(description = "面试权重。")
    private Double meetingWeight;

    @Schema(description = "薪资最高范围")
    private Integer max;

    @Schema(description = "薪资最低范围")
    private Integer min;

    @Schema(description = "学历要求")
    private Integer education;

    @Schema(description = "是否属于内部竞聘")
    private Integer outside;

    @Schema(description = "岗位要求。")
    private String requirements;


    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime gmtCreate;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "上次创建时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime gmtModified;


    @Schema(description = "乐观锁")
    @Version
    @TableField(fill = FieldFill.INSERT)
    private Integer version;

    @Schema(description = "逻辑是否删除")
    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    private Integer isDelete;


}
